package com.qutan.app.quartz;

import com.qutan.app.quartz.event.TestEvent;
import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.impl.JobDetailImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import redis.clients.jedis.JedisCluster;

/**
 * Created by pengweiyuan on 4/22/16.
 */
public class QuartzJob implements Job{

    public void execute(JobExecutionContext jobExecutionContext) throws JobExecutionException {
       /* JobDetail jobDetail=jobExecutionContext.getJobDetail();
        String jobName = ((JobDetailImpl)jobDetail).getName();   //任务名称
*/
        String jobName= jobExecutionContext.getTrigger().getKey().getName();
        System.err.println(jobName);
        TestEvent.execute();
       /* org.quartz.plugins.xml.JobInitializationPlugin()*/
    }
}
